package com.mvvm.store.ui.stockup;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;

import com.mvvm.store.base.BaseViewModel;
import com.mvvm.store.base.RepositoryImpl;
import com.mvvm.store.bean.StockUpParasBean;
import com.mvvm.store.bean.basebean.IntoSubmitPramsBean;
import com.mvvm.store.bean.basebean.IntoSubmitResultBean;
import com.mvvm.store.bean.basebean.MeterialInfroResultBean;
import com.mvvm.store.bean.basebean.ParamsBuilder;
import com.mvvm.store.bean.basebean.Resource;
import com.mvvm.store.bean.basebean.StockUpGetListResultBean;
import com.mvvm.store.bean.basebean.StockUpResultBean;
import com.mvvm.store.bean.basebean.StockUpSubmitParams;
import com.mvvm.store.bean.basebean.StockUpSubmitResultBean;
import com.mvvm.store.bean.basebean.UserAuthenticationBean;

import java.util.List;

/**
 * Created by leo
 * on 2019/10/16.
 * 入库请求
 * 从每个页面的ViewModel里，就能看出每个页面的功能和联网请求。类似于MVP里的契约类
 */
public class StockUpViewModel extends BaseViewModel<RepositoryImpl> {


    public StockUpViewModel(@NonNull Application application) {
        super(application);
    }


    //获取备货列表数据
    public LiveData<Resource<List<StockUpResultBean>>> getStockUpList(StockUpParasBean stockUpParasBean, ParamsBuilder paramsBuilder) {
        return getRepository().getStockUpList(stockUpParasBean, paramsBuilder);
    }

    //获取备货零件列表数据
    public LiveData<Resource<List<StockUpGetListResultBean>>> getStockIdList(String stockOrderNo) {
        return getRepository().getStockIdList(stockOrderNo);
    }

    //备货提交 stockUpSubmit
    public LiveData<Resource<StockUpSubmitResultBean>> stockUpSubmit(List<StockUpSubmitParams> stockUpSubmitParams){
        return  getRepository().stockUpSubmit(stockUpSubmitParams);
    }

    //用户验证 userAuthentication
    public LiveData<Resource<String>> userAuthentication(UserAuthenticationBean userAuthenticationBean){
        return  getRepository().userAuthentication(userAuthenticationBean);
    }


}
